package demo;

import java.time.LocalDateTime;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import util.AppEventUtil;


@Component
public class MyApplicationListener implements ApplicationListener<ApplicationEvent>{
	
	public MyApplicationListener(){
		System.out.println("MyApplicationListener() run,"+LocalDateTime.now());
	}
	
	@Override
	public void onApplicationEvent(ApplicationEvent event){
		
		System.out.println("onApplicationEvent,"+event+","+Thread.currentThread());
		AppEventUtil.add(event);
		
		
		
	}

}